/*
* Copyright (c) 2016 . All Rights Reserved.
*/
package com.cgmnx.admin.biz.rbac;

import com.cgmnx.admin.common.bean.Limiter;
import com.cgmnx.admin.dao.entity.rbac.RoleEntity;

import java.util.List;


/**
 * 删除功能：
 * <li>
 * <ul>删除角色对应的资源</ul>
 * <ul>删除角色对应的用户</ul>
 * <ul>删除角色</ul>
 * <ul>保存日志</ul>
 * </li>
 * <p>
 * 分配功能：
 * <li>
 * <ul>给该角色分配资源</ul>
 * <ul>保存日志</ul>
 * </li>
 *
 * @author: created  Date: 16/12/11 Time: 下午7:07
 * @version: 1.0
 */
public interface RoleBiz {

    Integer save(RoleEntity roleEntity);

    Integer update(RoleEntity convert);

    Void updateValidStatus(List<Integer> idList);

    Void updateInValidStatus(List<Integer> idList);

    Void allocationResource(Integer roleId, List<Integer> resourceIdList, String userId);

    Integer count(String searchName);

    List<RoleEntity> queryPage(String searchName, Limiter limiter);

    RoleEntity query(Integer roleId);

    List<RoleEntity> queryAll();

    List<RoleEntity> queryByUserIdList(List<String> userIdList);

    Integer countRelationUser(Integer id);

    List<RoleEntity> queryRelationUserPage(Integer id, Limiter limiter);

    Void bindingUser(Integer roleId, List<String> userIds, String userId);
}